Remove a few more unused variables
authorSam Reed <reedy@users.mediawiki.org>
Sun, 31 Oct 2010 23:19:40 +0000 (23:19 +0000)
committerSam Reed <reedy@users.mediawiki.org>
Sun, 31 Oct 2010 23:19:40 +0000 (23:19 +0000)
Add a couple of braces to unobvious if

includes/ConfEditor.php
includes/GlobalFunctions.php
includes/LogEventsList.php
includes/MessageCache.php
includes/Skin.php
includes/User.php
includes/UserMailer.php
includes/db/DatabaseIbm_db2.php
includes/installer/Installer.php
maintenance/tests/parser/parserTest.inc
skins/Vector.php

index 4bd55ac..d62a9ce 100644 (file)
@@ -510,7 +510,6 @@ class ConfEditor {
                        $indent = false;
                }
                if ( $indent !== false && $arrowPos !== false ) {
-                       $textToInsert = "$indent$key ";
                        $arrowIndentLength = $arrowPos - $pos - $indentLength - strlen( $key );
                        if ( $arrowIndentLength > 0 ) {
                                $arrowIndent = str_repeat( ' ', $arrowIndentLength );
index 6fc7f16..c082acc 100644 (file)
@@ -425,13 +425,11 @@ function wfErrorLog( $text, $file ) {
                # Needs the sockets extension
                if ( preg_match( '!^(tcp|udp):(?://)?\[([0-9a-fA-F:]+)\]:(\d+)(?:/(.*))?$!', $file, $m ) ) {
                        // IPv6 bracketed host
-                       $protocol = $m[1];
                        $host = $m[2];
                        $port = intval( $m[3] );
                        $prefix = isset( $m[4] ) ? $m[4] : false;
                        $domain = AF_INET6;
                } elseif ( preg_match( '!^(tcp|udp):(?://)?([a-zA-Z0-9.-]+):(\d+)(?:/(.*))?$!', $file, $m ) ) {
-                       $protocol = $m[1];
                        $host = $m[2];
                        if ( !IP::isIPv4( $host ) ) {
                                $host = gethostbyname( $host );
index c9b91f1..820793a 100644 (file)
@@ -460,7 +460,6 @@ class LogEventsList {
                        if( count($paramArray) >= 1 ) {
                                $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
                                // $paramArray[1] is a CSV of the IDs
-                               $Ids = explode( ',', $paramArray[0] );
                                $query = $paramArray[0];
                                // Link to each hidden object ID, $paramArray[1] is the url param
                                $revert = '(' . $this->skin->link(
index 0afb2df..1e98d5a 100644 (file)
@@ -634,7 +634,6 @@ class MessageCache {
         */
        function getMsgFromNamespace( $title, $code ) {
                global $wgAdaptiveMessageCache;
-               $big = false;
 
                $this->load( $code );
                if ( isset( $this->mCache[$code][$title] ) ) {
index f31fc9b..cc1f2f5 100644 (file)
@@ -531,17 +531,11 @@ class Skin extends Linker {
         */
        function setupUserCss( OutputPage $out ) {
                global $wgRequest;
-               global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs, $wgSquidMaxage;
+               global $wgUseSiteCss, $wgAllowUserCss, $wgAllowUserCssPrefs;
 
                wfProfileIn( __METHOD__ );
 
                $this->setupSkinUserCss( $out );
-
-               $siteargs = array(
-                       'action' => 'raw',
-                       'maxage' => $wgSquidMaxage,
-               );
-
                // Add any extension CSS
                foreach ( $out->getExtStyle() as $url ) {
                        $out->addStyle( $url );
index 80ecd46..25e0e52 100644 (file)
@@ -693,7 +693,6 @@ class User {
                }
 
                # Reject various classes of invalid names
-               $name = $t->getText();
                global $wgAuth;
                $name = $wgAuth->getCanonicalName( $t->getText() );
 
index 3033779..4121245 100644 (file)
@@ -471,13 +471,14 @@ class EmailNotification {
                        $keys['$CHANGEDORCREATED'] = wfMsgForContent( 'created' );
                }
 
-               if ($wgEnotifImpersonal && $this->oldid)
+               if ($wgEnotifImpersonal && $this->oldid) {
                        /*
                         * For impersonal mail, show a diff link to the last
                         * revision.
                         */
                        $keys['$NEWPAGE'] = wfMsgForContent('enotif_lastdiff',
                                        $this->title->getFullURL("oldid={$this->oldid}&diff=next"));
+        }
 
                $body = strtr( $body, $keys );
                $pagetitle = $this->title->getPrefixedText();
index b695d0b..60a4190 100644 (file)
@@ -607,7 +607,6 @@ EOF;
                        } else {
                                print '<li>Foreign keys done</li>';
                        }
-                       $res = null;
 
                        // TODO: populate interwiki links
 
index e416818..266a631 100644 (file)
@@ -683,7 +683,7 @@ abstract class Installer {
                }
 
                # Get a list of available locales.
-               $lines = $ret = false;
+               $ret = false;
                $lines = wfShellExec( '/usr/bin/locale -a', $ret );
 
                if ( $ret ) {
index a62d628..afd2f81 100644 (file)
@@ -515,7 +515,6 @@ class ParserTest {
 
        private function parseOptions( $instring ) {
                $opts = array();
-               $lines = explode( "\n", $instring );
                // foo
                // foo=bar
                // foo="bar baz"
@@ -554,7 +553,7 @@ class ParserTest {
 
                if ( preg_match_all( $regex, $instring, $matches, PREG_SET_ORDER ) ) {
                        foreach ( $matches as $bits ) {
-                               $match = array_shift( $bits );
+                               array_shift( $bits );
                                $key = strtolower( array_shift( $bits ) );
                                if ( count( $bits ) == 0 ) {
                                        $opts[$key] = true;
index d61c1f8..679d244 100644 (file)
@@ -680,7 +680,7 @@ class VectorTemplate extends QuickTemplate {
 <div id="p-namespaces" class="vectorTabs<?php if ( count( $this->data['namespace_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
        <h5><?php $this->msg('namespaces') ?></h5>
        <ul<?php $this->html('userlangattributes') ?>>
-               <?php foreach ($this->data['namespace_urls'] as $key => $link ): ?>
+               <?php foreach ($this->data['namespace_urls'] as $link ): ?>
                        <li <?php echo $link['attributes'] ?>><span><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></span></li>
                <?php endforeach; ?>
        </ul>
@@ -692,7 +692,7 @@ class VectorTemplate extends QuickTemplate {
 <div id="p-variants" class="vectorMenu<?php if ( count( $this->data['variant_urls'] ) == 0 ) echo ' emptyPortlet'; ?>">
        <?php if ( $wgVectorShowVariantName ): ?>
                <h4>
-               <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
+               <?php foreach ( $this->data['variant_urls'] as $link ): ?>
                        <?php if ( stripos( $link['attributes'], 'selected' ) !== false ): ?>
                                <?php echo htmlspecialchars( $link['text'] ) ?>
                        <?php endif; ?>
@@ -702,7 +702,7 @@ class VectorTemplate extends QuickTemplate {
        <h5><span><?php $this->msg('variants') ?></span><a href="#"></a></h5>
        <div class="menu">
                <ul<?php $this->html('userlangattributes') ?>>
-                       <?php foreach ( $this->data['variant_urls'] as $key => $link ): ?>
+                       <?php foreach ( $this->data['variant_urls'] as $link ): ?>
                                <li<?php echo $link['attributes'] ?>><a href="<?php echo htmlspecialchars( $link['href'] ) ?>" <?php echo $link['key'] ?>><?php echo htmlspecialchars( $link['text'] ) ?></a></li>
                        <?php endforeach; ?>
                </ul>